﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Autofac;
using Unis.Framework.Core.Infrastructure;
using Unis.Framework.Core.Infrastructure.DependencyManagement;

using ScmCostPlanService;
using ScmCostActualmainService;
using ScmCostActualService;
using ScmCostLedgerService;
using KingRoad.EPM.SafetyManagementBLL.UIRules;
using KingRoad.EPM.SafetyManagementDAL.BfUserService;
using KingRoad.EPM.SafetyManagementDAL.ScmSafetyassessmentService;
using KingRoad.EPM.SafetyManagementDAL.ScmSafetyknowledgeService;
using KingRoad.EPM.SafetyManagementDAL.SafeProductionService;
using KingRoad.EPM.SafetyManagementDAL.ScmAssessmentitemsService;
using KingRoad.EPM.SafetyManagementDAL.ScmCostPlanMainService;
using KingRoad.EPM.SafetyManagementDAL.ScmSafetyconstructiondicService;
using KingRoad.EPM.SafetyManagementDAL.ProjectUnitService;
using KingRoad.EPM.SafetyManagementDAL.SafesupervisionService;
using KingRoad.EPM.SafetyManagementDAL.ScmAssessmentunitService;
using KingRoad.EPM.SafetyManagementDAL.ScmAssessmentscoreService;
using KingRoad.EPM.SafetyManagementDAL.SpecialEquipmentService;
using KingRoad.EPM.SafetyManagementDAL.SpecialPersonnelService;
using KingRoad.EPM.SafetyManagementDAL.RiskAssessService;
using KingRoad.EPM.SafetyManagementDAL.ScmDailycheckService;
using KingRoad.EPM.SafetyManagementDAL.ProjectSegmentService;
using KingRoad.EPM.SafetyManagementDAL.ScmAuditService;
using KingRoad.EPM.SafetyManagementDAL.ProjectSupervisingService;
using KingRoad.EPM.SafetyManagementDAL.ProjectSupervisionService;
using KingRoad.EPM.SafetyManagementDAL.ProjectVerifyService;
using KingRoad.EPM.SafetyManagementDAL.ScmSecurecostService;
using KingRoad.EPM.SafetyManagementDAL.ScmPotentialAdviceService;
using KingRoad.EPM.SafetyManagementDAL.ScmThreePersonnelService;
using KingRoad.EPM.SafetyManagementDAL.PlmPersonLeaveService;

using Unis.Framework.Core.Infrastructure.DependencyManagement;

namespace KingRoad.EPM.Web.Areas.SafetyConstruction
{
    public class DependencyRegistrar : IDependencyRegistrar
    {
        #region IDependencyRegistrar 成员

        public int Order { get; private set; }

        public void Register(ContainerBuilder builder, ITypeFinder typeFinder)
        {
            #region 注册业务逻辑方法
            builder.RegisterType<BfUserUIRule>();
            builder.RegisterType<ScmSafetyconstructiondicUIRule>();
            builder.RegisterType<ScmSafetyknowledgeUIRule>();
            builder.RegisterType<ScmSafeproductionUIRule>();
            builder.RegisterType<ScmSafetyassessmentUIRule>();
            builder.RegisterType<ScmAssessmentitemsUIRule>();
            builder.RegisterType<ProjectUnitUIRule>();
            builder.RegisterType<ScmCostplanmainUIRule>();
            builder.RegisterType<ScmCostactualmainUIRule>();
            builder.RegisterType<ScmCostledgerUIRule>();
            builder.RegisterType<ScmAssessmentunitUIRule>();
            builder.RegisterType<ScmAssessmentscoreUIRule>();
            builder.RegisterType<ScmSafesupervisionUIRule>();
            builder.RegisterType<ScmSpecialequipmentUIRule>();
            builder.RegisterType<ScmSpecialpersonnelUIRule>();
            builder.RegisterType<ScmRiskassessUIRule>();
            builder.RegisterType<ScmDailycheckUIRule>();

            builder.RegisterType<ProjectSegmentUIRule>();

            builder.RegisterType<ScmAuditUIRule>();

            builder.RegisterType<ProjectSupervisingUIRule>();
            builder.RegisterType<ProjectSupervisionUIRule>();
            builder.RegisterType<ProjectVerifyUIRule>();
            builder.RegisterType<ScmSecurecostUIRule>();
            builder.RegisterType<ScmPotentialadviceUIRule>();
            builder.RegisterType<ScmThreepersonnelUIRule>();
            builder.RegisterType<PlmPersonleaveUIRule>();

            builder.RegisterType<CommonFileUIRule>();
            #endregion

            #region 数据访问层注册解析

            builder.RegisterType<BfUserService>().As<IBfUserService>();
            builder.RegisterType<ScmSafetyconstructiondicService>().As<IScmSafetyconstructiondicService>();
            builder.RegisterType<ScmSafetyknowledgeService>().As<IScmSafetyknowledgeService>();
            builder.RegisterType<ScmSafeproductionService>().As<IScmSafeproductionService>();
            builder.RegisterType<ScmSafetyassessmentService>().As<IScmSafetyassessmentService>();
            builder.RegisterType<ScmCostplanmainService>().As<IScmCostplanmainService>();
            builder.RegisterType<ScmAssessmentitemsService>().As<IScmAssessmentitemsService>();
            builder.RegisterType<ProjectUnitService>().As<IProjectUnitService>();
            builder.RegisterType<ScmCostplanService>().As<IScmCostplanService>();
            builder.RegisterType<ScmCostactualmainService>().As<IScmCostactualmainService>();
            builder.RegisterType<ScmCostactualService>().As<IScmCostactualService>();
            builder.RegisterType<ScmAssessmentunitService>().As<IScmAssessmentunitService>();
            builder.RegisterType<ScmAssessmentscoreService>().As<IScmAssessmentscoreService>();

            builder.RegisterType<ScmSafesupervisionService>().As<IScmSafesupervisionService>();
            builder.RegisterType<ScmSpecialequipmentService>().As<IScmSpecialequipmentService>();
            builder.RegisterType<ScmSpecialpersonnelService>().As<IScmSpecialpersonnelService>();
            builder.RegisterType<ScmRiskassessService>().As<IScmRiskassessService>();
            builder.RegisterType<ScmSafesupervisionService>().As<IScmSafesupervisionService>();
            builder.RegisterType<ScmSpecialequipmentService>().As<IScmSpecialequipmentService>();
            builder.RegisterType<ScmSpecialpersonnelService>().As<IScmSpecialpersonnelService>();
            builder.RegisterType<ScmDailycheckService>().As<IScmDailycheckService>();
            builder.RegisterType<ScmCostledgerService>().As<IScmCostledgerService>();

            builder.RegisterType<ProjectSegmentService>().As<IProjectSegmentService>();

            builder.RegisterType<ScmAuditService>().As<IScmAuditService>();

            builder.RegisterType<ProjectSupervisingService>().As<IProjectSupervisingService>();
            builder.RegisterType<ProjectSupervisionService>().As<IProjectSupervisionService>();
            builder.RegisterType<ProjectVerifyService>().As<IProjectVerifyService>();
            builder.RegisterType<ScmSecurecostService>().As<IScmSecurecostService>();
            builder.RegisterType<ScmPotentialadviceService>().As<IScmPotentialadviceService>();
            builder.RegisterType<ScmThreepersonnelService>().As<IScmThreepersonnelService>();
            builder.RegisterType<PlmPersonleaveService>().As<IPlmPersonleaveService>();

            builder.RegisterType<CommonFileService>().As<ICommonFileService>();
            #endregion
        }

        #endregion
    }
}